<?php
/**
 * Yii view form
 *
 * @author luubk
 * @since Jan 14, 2013 - 11:14:48 AM
 */
$auth     = Yii::app()->authManager;
$authitem = $auth->getAuthItem($this->model->name);
if ($authitem == NULL)
{

    class NewAuth
    {

        public $nameb       = 'new';
        public $description = 'new';
        public $data;
        public $rule;

        public function hasChild($param)
        {
            return FALSE;
        }

    }

    $authitem = new NewAuth;
}

$type = isset($_GET['type']) ? $_GET['type'] : '';
?>
<div class="row-fluid">
    <div class="box span12">
        <div class="box-header">
            <h2>
                <i class="icon-user"></i><span class="break"></span>
                <?php echo ucfirst($this->model->description) ?>
            </h2>
            <div class="box-icon">
                <a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
                <a href="#" class="btn-minimize"><i class="icon-chevron-down"></i></a>
                <a href="#" class="btn-close"><i class="icon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">


            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'enableClientValidation' => true,
                'htmlOptions'            => array(
                    'class' => 'form-horizontal'
                )
            ));
            ?>
            <fieldset>                                
                <div class="control-group">
                    <?php
                    echo $form->labelEx($this->model, 'name', array(
                        'class' => 'control-label'
                    ))
                    ?>
                    <div class="controls">
                        <?php echo $form->textField($this->model, "name"); ?>
                        <?php echo $form->error($this->model, "name"); ?>
                    </div>
                </div>
                <div class="control-group">
                    <?php
                    echo $form->labelEx($this->model, 'description', array(
                        'class' => 'control-label'
                    ))
                    ?>
                    <div class="controls">
                        <?php echo $form->textField($this->model, "description"); ?>
                        <?php echo $form->hiddenField($this->model, "bizrule", array('value', NULL)); ?>
                        <?php echo $form->error($this->model, "description"); ?>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <input type="submit" class="btn btn-primary" value="<?php echo Yii::t('form', 'Save') ?>"/>
                        <input type="reset" class="btn" value="<?php echo Yii::t('form', 'Reset') ?>"/>
                        <div class="clear"></div>
                    </div>
                </div>
            </fieldset>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>